const stringUtil = require('./stringUtil')

let idCounter = 0

/**
 * 生成uid 格式：1055531555485799
 */
const createUid = ()=>{
    const time = stringUtil.formatDate(null, 'YYYYMMDDhhmmss')
    const randomStr = stringUtil.random(1000, 9999)
    const result = `${time}${++idCounter}${randomStr}`
    return result
}

module.exports = {
    createUid
}